﻿using System.Windows;
using System.Windows.Input;
using DL.PhotoCollage.UI.Screensaver.Presentation;

namespace DL.PhotoCollage.UI.Screensaver.Views
{
    public partial class ScreensaverView : Window
    {
        internal ScreensaverView(ScreensaverPresenter presenter)
        {
            this.InitializeComponent();
            this.DataContext = presenter;
        }

        internal ScreensaverPresenter Presenter
        {
            get { return this.DataContext as ScreensaverPresenter; }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.Presenter.StartAnimation();
        }

        private void Window_KeyDown(object sender, KeyEventArgs e)
        {
            this.Presenter.KeyDown();
        }

        private void Window_MouseDown(object sender, MouseButtonEventArgs e)
        {
            this.Presenter.MouseDown();
        }

        private void Window_MouseMove(object sender, MouseEventArgs e)
        {
            this.Presenter.MouseMove(e.MouseDevice.GetPosition(this));
        }
    }
}
